package com.itheima.stock.mapper;

import com.itheima.stock.pojo.domain.UserAddDomain;
import com.itheima.stock.pojo.entity.SysUser;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;

/**
* @author 13975
* @description 针对表【sys_user(用户表)】的数据库操作Mapper
* @createDate 2024-04-21 19:31:27
* @Entity com.itheima.stock.pojo.entity.SysUser
*/
public interface SysUserMapper {

    int deleteByPrimaryKey(Long id);

    int insert(SysUser record);

    int insertSelective(SysUser record);

    SysUser selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysUser record);

    int updateByPrimaryKey(SysUser record);

    SysUser findUserInfoByUserName(@Param("username") String username);

    /**
     * 查询所有信息
     * @return
     */
    List<SysUser> findAll();

    /**
     * 根据条件查找用户信息
     * @param userName
     * @param nickName
     * @param startTime
     * @param endTime
     * @return
     */
    List<SysUser> getUsersByParam(@Param("userName")String userName,@Param("nickName")String nickName,@Param("startTime")Date startTime,@Param("endTime")Date endTime);

    /**
     * 按用户姓名查找用户
     * @param username
     */
    SysUser selectByUsername(@Param("userName")String username);

    /**
     * 按照用户id查找该用户具有的角色id
     * @param id
     * @return
     */
    List<Long> getUserRoleIds(@Param("id")String id);

    /**
     * 根据用户id进行批量删除
     * @param userIds
     */
    int deleteBatchByIds(List<Long> userIds);

}
